<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <base href="${pageContext.request.scheme}://${pageContext.request.serverName}:${pageContext.request.serverPort}${pageContext.request.contextPath}/">
    <script src="resources/js/lib/sea.js"></script>
    <script type="text/javascript">
        seajs.config({
            base: "${pageContext.request.scheme}://${pageContext.request.serverName}:${pageContext.request.serverPort}${pageContext.request.contextPath}/resources/"
        });
        seajs.use(["css/admin/main.css", "js/lib/jquery", "js/lib/core/jquery.cms.core", "js/base/jquery.ui.all.css","js/cms.channel_list_tree_child"],
                function (cmscss, $, cmscore, juicss) {
                    cmscore($);
                    $(".listTable").trColorChange();
                    $("a.delete").confirmOperator();
                    if($("#refresh").val()==1) {
                        alert(123);
                        parent.rt(); //刷新树

                    }

                });


    </script>
</head>
<body>
<div id="content">
    <h3 class="admin_link_bar">
        <jsp:include page="inc.jsp"/>
    </h3>
<%--    排序不刷新--%>
    <input type="hidden" id="refresh" value="${refresh }"/>
    <table width="580" cellspacing="0" cellPadding="0" class="listTable">
        <thead>
        <tr>
            <td>栏目名称</td>
            <td>栏目类型</td>
            <td>是否推荐</td>
            <td>主页栏目</td>
            <td>栏目状态</td>
            <Td>操作</Td>
        </tr>
        </thead>
        <tbody>
        <c:forEach items="${channels }" var="c">
            <tr id="id_${c.id }">
                <td>
                        ${c.name }&nbsp;
                </td>
                <td class="ctype">${c.type.name }</td>
                <td>
                    <c:if test="${c.recommed eq 0 }"><span class="emp">不推荐</span></c:if>
                    <c:if test="${c.recommed eq 1 }">推荐</c:if>&nbsp;
                </td>
                <td>
                    <c:if test="${c.index eq 0 }"><span class="emp">不是</span></c:if>
                    <c:if test="${c.index eq 1 }">是</c:if> &nbsp;
                </td>
                <td><c:if test="${c.status eq 0 }">启用</c:if>
                    <c:if test="${c.status eq 1 }"><span class="emp">停用</span></c:if>&nbsp;
                </td>
                <td class="centerTd">
                    <a href="admin/channel/update/${c.id}" class="list_op"> 更新</a>
                        <%--
                                pid是lsitChild方法的url里的pid,因为listChild是服务器跳转,或者使用pc.id取得父id,
                                 @RequestMapping("/channels/{pid}")
                                 public String listChild
                        --%>
                    <a href="admin/channel/delete/${pid}/${c.id}" class="list_op delete">删除</a>
                </td>
            </tr>
        </c:forEach>
        </tbody>
        <tfoot>
        <tr>
            <td colspan="6" class="rightTd">
                <a id="beginOrder" href="#" title="#"  class="list_op">开始排序</a> &nbsp;
                <a id="saveOrder"  href="#" title="#"   class="list_op">存储排序</a> &nbsp;
            </td>
        </tr>
        </tfoot>
    </table>
</div>
</body>
</html>